Deprecate GtkMisc
authorMatthias Clasen <mclasen@redhat.com>
Tue, 13 May 2014 12:45:00 +0000 (08:45 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 13 May 2014 12:45:00 +0000 (08:45 -0400)
This has been dangling ever since 3.0.

17 files changed:
docs/reference/gtk/gtk-docs.sgml
gtk/Makefile.am
gtk/deprecated/gtkmisc.c [new file with mode: 0644]
gtk/deprecated/gtkmisc.h [new file with mode: 0644]
gtk/gtk.h
gtk/gtkaccellabel.c
gtk/gtkarrow.c
gtk/gtkarrow.h
gtk/gtkassistant.c
gtk/gtkbutton.c
gtk/gtkimage.c
gtk/gtkimage.h
gtk/gtklabel.c
gtk/gtklabel.h
gtk/gtkmisc.c [deleted file]
gtk/gtkmisc.h [deleted file]
gtk/gtktoolbutton.c

index 8707cfc72e4ebd45260f389bfba4664fad4a0e09..8e749b464be9b493a8da7a1a356907c455471545 100644 (file)
       <xi:include href="xml/gtkcontainer.xml" />
       <xi:include href="xml/gtkbin.xml" />
       <xi:include href="xml/gtkmenushell.xml" />
-      <xi:include href="xml/gtkmisc.xml" />
       <xi:include href="xml/gtkrange.xml" />
       <xi:include href="xml/gtkimcontext.xml" />
     </chapter>
       <xi:include href="xml/gtkrecentaction.xml" />
       <xi:include href="xml/gtkactivatable.xml" />
       <xi:include href="xml/gtkimagemenuitem.xml" />
+      <xi:include href="xml/gtkmisc.xml" />
       <xi:include href="xml/gtkstock.xml" />
       <xi:include href="xml/gtkiconfactory.xml" />
       <xi:include href="xml/gtknumerableicon.xml" />
index e4653d0d5fd950819d2eafbce05fd0c79f93fba8..26539a9845da67b48ebc3770831601df1bcade9b 100644 (file)
@@ -171,6 +171,7 @@ deprecated_h_sources =                      \
        deprecated/gtkhsv.h             \
        deprecated/gtkiconfactory.h     \
        deprecated/gtkimagemenuitem.h   \
+       deprecated/gtkmisc.h            \
        deprecated/gtknumerableicon.h   \
        deprecated/gtkradioaction.h     \
        deprecated/gtkrc.h              \
@@ -303,7 +304,6 @@ gtk_public_h_sources =              \
        gtkmenushell.h          \
        gtkmenutoolbutton.h     \
        gtkmessagedialog.h      \
-       gtkmisc.h               \
        gtkmodules.h            \
        gtkmountoperation.h     \
        gtknotebook.h           \
@@ -596,6 +596,7 @@ deprecated_c_sources =                      \
        deprecated/gtkhsv.c             \
        deprecated/gtkiconfactory.c     \
        deprecated/gtkimagemenuitem.c   \
+       deprecated/gtkmisc.c            \
        deprecated/gtknumerableicon.c   \
        deprecated/gtkradioaction.c     \
        deprecated/gtkrc.c              \
@@ -799,7 +800,6 @@ gtk_base_c_sources =                \
        gtkmenutrackeritem.c    \
        gtkmenutoolbutton.c     \
        gtkmessagedialog.c      \
-       gtkmisc.c               \
        gtkmnemonichash.c       \
        gtkmodelmenuitem.c      \
        gtkmodelbutton.c        \
diff --git a/gtk/deprecated/gtkmisc.c b/gtk/deprecated/gtkmisc.c
new file mode 100644 (file)
index 0000000..303b5e7
--- /dev/null
@@ -0,0 +1,441 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
+ * file for a list of people on the GTK+ Team.  See the ChangeLog
+ * files for a list of changes.  These files are distributed with
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
+ */
+
+#include "config.h"
+#include "gtkcontainer.h"
+#include "gtkmisc.h"
+#include "gtkintl.h"
+#include "gtkprivate.h"
+
+
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
+/**
+ * SECTION:gtkmisc
+ * @Short_description: Base class for widgets with alignments and padding
+ * @Title: GtkMisc
+ *
+ * The #GtkMisc widget is an abstract widget which is not useful itself, but
+ * is used to derive subclasses which have alignment and padding attributes.
+ *
+ * The horizontal and vertical padding attributes allows extra space to be
+ * added around the widget.
+ *
+ * The horizontal and vertical alignment attributes enable the widget to be
+ * positioned within its allocated area. Note that if the widget is added to
+ * a container in such a way that it expands automatically to fill its
+ * allocated area, the alignment settings will not alter the widgets position.
+ *
+ * Note that the desired effect can in most cases be achieved by using the
+ * #GtkWidget:halign, #GtkWidget:valign and #GtkWidget:margin properties
+ * on the child widget, so GtkMisc should not be used in new code. To reflect
+ * this fact, all #GtkMisc API has been deprecated.
+ */
+
+struct _GtkMiscPrivate
+{
+  gfloat        xalign;
+  gfloat        yalign;
+
+  guint16       xpad;
+  guint16       ypad;
+};
+
+enum {
+  PROP_0,
+  PROP_XALIGN,
+  PROP_YALIGN,
+  PROP_XPAD,
+  PROP_YPAD
+};
+
+static void gtk_misc_realize      (GtkWidget    *widget);
+static void gtk_misc_set_property (GObject         *object,
+                                  guint            prop_id,
+                                  const GValue    *value,
+                                  GParamSpec      *pspec);
+static void gtk_misc_get_property (GObject         *object,
+                                  guint            prop_id,
+                                  GValue          *value,
+                                  GParamSpec      *pspec);
+
+
+G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GtkMisc, gtk_misc, GTK_TYPE_WIDGET)
+
+static void
+gtk_misc_class_init (GtkMiscClass *class)
+{
+  GObjectClass   *gobject_class;
+  GtkWidgetClass *widget_class;
+
+  gobject_class = G_OBJECT_CLASS (class);
+  widget_class = (GtkWidgetClass*) class;
+
+  gobject_class->set_property = gtk_misc_set_property;
+  gobject_class->get_property = gtk_misc_get_property;
+  
+  widget_class->realize = gtk_misc_realize;
+
+  g_object_class_install_property (gobject_class,
+                                   PROP_XALIGN,
+                                   g_param_spec_float ("xalign",
+                                                      P_("X align"),
+                                                      P_("The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL layouts."),
+                                                      0.0,
+                                                      1.0,
+                                                      0.5,
+                                                      GTK_PARAM_READWRITE|G_PARAM_DEPRECATED));
+
+  g_object_class_install_property (gobject_class,
+                                   PROP_YALIGN,
+                                   g_param_spec_float ("yalign",
+                                                      P_("Y align"),
+                                                      P_("The vertical alignment, from 0 (top) to 1 (bottom)"),
+                                                      0.0,
+                                                      1.0,
+                                                      0.5,
+                                                      GTK_PARAM_READWRITE|G_PARAM_DEPRECATED));
+
+  g_object_class_install_property (gobject_class,
+                                   PROP_XPAD,
+                                   g_param_spec_int ("xpad",
+                                                    P_("X pad"),
+                                                    P_("The amount of space to add on the left and right of the widget, in pixels"),
+                                                    0,
+                                                    G_MAXINT,
+                                                    0,
+                                                    GTK_PARAM_READWRITE|G_PARAM_DEPRECATED));
+
+  g_object_class_install_property (gobject_class,
+                                   PROP_YPAD,
+                                   g_param_spec_int ("ypad",
+                                                    P_("Y pad"),
+                                                    P_("The amount of space to add on the top and bottom of the widget, in pixels"),
+                                                    0,
+                                                    G_MAXINT,
+                                                    0,
+                                                    GTK_PARAM_READWRITE|G_PARAM_DEPRECATED));
+}
+
+static void
+gtk_misc_init (GtkMisc *misc)
+{
+  GtkMiscPrivate *priv;
+
+  misc->priv = gtk_misc_get_instance_private (misc); 
+  priv = misc->priv;
+
+  priv->xalign = 0.5;
+  priv->yalign = 0.5;
+  priv->xpad = 0;
+  priv->ypad = 0;
+}
+
+static void
+gtk_misc_set_property (GObject      *object,
+                      guint         prop_id,
+                      const GValue *value,
+                      GParamSpec   *pspec)
+{
+  GtkMisc *misc = GTK_MISC (object);
+  GtkMiscPrivate *priv = misc->priv;
+
+  switch (prop_id)
+    {
+    case PROP_XALIGN:
+      gtk_misc_set_alignment (misc, g_value_get_float (value), priv->yalign);
+      break;
+    case PROP_YALIGN:
+      gtk_misc_set_alignment (misc, priv->xalign, g_value_get_float (value));
+      break;
+    case PROP_XPAD:
+      gtk_misc_set_padding (misc, g_value_get_int (value), priv->ypad);
+      break;
+    case PROP_YPAD:
+      gtk_misc_set_padding (misc, priv->xpad, g_value_get_int (value));
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+    }
+}
+
+static void
+gtk_misc_get_property (GObject      *object,
+                      guint         prop_id,
+                      GValue       *value,
+                      GParamSpec   *pspec)
+{
+  GtkMisc *misc = GTK_MISC (object);
+  GtkMiscPrivate *priv = misc->priv;
+
+  switch (prop_id)
+    {
+    case PROP_XALIGN:
+      g_value_set_float (value, priv->xalign);
+      break;
+    case PROP_YALIGN:
+      g_value_set_float (value, priv->yalign);
+      break;
+    case PROP_XPAD:
+      g_value_set_int (value, priv->xpad);
+      break;
+    case PROP_YPAD:
+      g_value_set_int (value, priv->ypad);
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+    }
+}
+
+/**
+ * gtk_misc_set_alignment:
+ * @misc: a #GtkMisc.
+ * @xalign: the horizontal alignment, from 0 (left) to 1 (right).
+ * @yalign: the vertical alignment, from 0 (top) to 1 (bottom).
+ *
+ * Sets the alignment of the widget.
+ *
+ * Deprecated: 3.14: Use #GtkWidget alignment and margin properties.
+ */
+void
+gtk_misc_set_alignment (GtkMisc *misc,
+                       gfloat   xalign,
+                       gfloat   yalign)
+{
+  GtkMiscPrivate *priv;
+  GtkWidget *widget;
+
+  g_return_if_fail (GTK_IS_MISC (misc));
+
+  priv = misc->priv;
+
+  if (xalign < 0.0)
+    xalign = 0.0;
+  else if (xalign > 1.0)
+    xalign = 1.0;
+
+  if (yalign < 0.0)
+    yalign = 0.0;
+  else if (yalign > 1.0)
+    yalign = 1.0;
+
+  if ((xalign != priv->xalign) || (yalign != priv->yalign))
+    {
+      g_object_freeze_notify (G_OBJECT (misc));
+      if (xalign != priv->xalign)
+       g_object_notify (G_OBJECT (misc), "xalign");
+
+      if (yalign != priv->yalign)
+       g_object_notify (G_OBJECT (misc), "yalign");
+
+      priv->xalign = xalign;
+      priv->yalign = yalign;
+      
+      /* clear the area that was allocated before the change
+       */
+      widget = GTK_WIDGET (misc);
+      if (gtk_widget_is_drawable (widget))
+        gtk_widget_queue_draw (widget);
+
+      g_object_thaw_notify (G_OBJECT (misc));
+    }
+}
+
+/**
+ * gtk_misc_get_alignment:
+ * @misc: a #GtkMisc
+ * @xalign: (out) (allow-none): location to store X alignment of @misc, or %NULL
+ * @yalign: (out) (allow-none): location to store Y alignment of @misc, or %NULL
+ *
+ * Gets the X and Y alignment of the widget within its allocation. 
+ * See gtk_misc_set_alignment().
+ *
+ * Deprecated: 3.14: Use #GtkWidget alignment and margin properties.
+ **/
+void
+gtk_misc_get_alignment (GtkMisc *misc,
+                       gfloat  *xalign,
+                       gfloat  *yalign)
+{
+  GtkMiscPrivate *priv;
+
+  g_return_if_fail (GTK_IS_MISC (misc));
+
+  priv = misc->priv;
+
+  if (xalign)
+    *xalign = priv->xalign;
+  if (yalign)
+    *yalign = priv->yalign;
+}
+
+/**
+ * gtk_misc_set_padding:
+ * @misc: a #GtkMisc.
+ * @xpad: the amount of space to add on the left and right of the widget,
+ *   in pixels.
+ * @ypad: the amount of space to add on the top and bottom of the widget,
+ *   in pixels.
+ *
+ * Sets the amount of space to add around the widget.
+ *
+ * Deprecated: 3.14: Use #GtkWidget alignment and margin properties.
+ */
+void
+gtk_misc_set_padding (GtkMisc *misc,
+                     gint     xpad,
+                     gint     ypad)
+{
+  GtkMiscPrivate *priv;
+
+  g_return_if_fail (GTK_IS_MISC (misc));
+
+  priv = misc->priv;
+
+  if (xpad < 0)
+    xpad = 0;
+  if (ypad < 0)
+    ypad = 0;
+
+  if ((xpad != priv->xpad) || (ypad != priv->ypad))
+    {
+      g_object_freeze_notify (G_OBJECT (misc));
+      if (xpad != priv->xpad)
+       g_object_notify (G_OBJECT (misc), "xpad");
+
+      if (ypad != priv->ypad)
+       g_object_notify (G_OBJECT (misc), "ypad");
+
+      priv->xpad = xpad;
+      priv->ypad = ypad;
+
+      if (gtk_widget_is_drawable (GTK_WIDGET (misc)))
+       gtk_widget_queue_resize (GTK_WIDGET (misc));
+
+      g_object_thaw_notify (G_OBJECT (misc));
+    }
+}
+
+/**
+ * gtk_misc_get_padding:
+ * @misc: a #GtkMisc
+ * @xpad: (out) (allow-none): location to store padding in the X
+ *        direction, or %NULL
+ * @ypad: (out) (allow-none): location to store padding in the Y
+ *        direction, or %NULL
+ *
+ * Gets the padding in the X and Y directions of the widget. 
+ * See gtk_misc_set_padding().
+ *
+ * Deprecated: 3.14: Use #GtkWidget alignment and margin properties.
+ **/
+void
+gtk_misc_get_padding (GtkMisc *misc,
+                     gint    *xpad,
+                     gint    *ypad)
+{
+  GtkMiscPrivate *priv;
+
+  g_return_if_fail (GTK_IS_MISC (misc));
+
+  priv = misc->priv;
+
+  if (xpad)
+    *xpad = priv->xpad;
+  if (ypad)
+    *ypad = priv->ypad;
+}
+
+static void
+gtk_misc_realize (GtkWidget *widget)
+{
+  GtkAllocation allocation;
+  GdkWindow *window;
+  GdkWindowAttr attributes;
+  gint attributes_mask;
+
+  gtk_widget_set_realized (widget, TRUE);
+
+  if (!gtk_widget_get_has_window (widget))
+    {
+      window = gtk_widget_get_parent_window (widget);
+      gtk_widget_set_window (widget, window);
+      g_object_ref (window);
+    }
+  else
+    {
+      gtk_widget_get_allocation (widget, &allocation);
+
+      attributes.window_type = GDK_WINDOW_CHILD;
+      attributes.x = allocation.x;
+      attributes.y = allocation.y;
+      attributes.width = allocation.width;
+      attributes.height = allocation.height;
+      attributes.wclass = GDK_INPUT_OUTPUT;
+      attributes.visual = gtk_widget_get_visual (widget);
+      attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK;
+      attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+
+      window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask);
+      gtk_widget_set_window (widget, window);
+      gtk_widget_register_window (widget, window);
+      gdk_window_set_background_pattern (window, NULL);
+    }
+}
+
+/* Semi-private function used by gtk widgets inheriting from
+ * GtkMisc that takes into account both css padding and border
+ * and the padding specified with the GtkMisc properties.
+ */
+void
+_gtk_misc_get_padding_and_border (GtkMisc   *misc,
+                                  GtkBorder *border)
+{
+  GtkStyleContext *context;
+  GtkStateFlags state;
+  GtkBorder tmp;
+  gint xpad, ypad;
+
+  g_return_if_fail (GTK_IS_MISC (misc));
+
+  context = gtk_widget_get_style_context (GTK_WIDGET (misc));
+  state = gtk_widget_get_state_flags (GTK_WIDGET (misc));
+
+  gtk_style_context_get_padding (context, state, border);
+
+  gtk_misc_get_padding (misc, &xpad, &ypad);
+  border->top += ypad;
+  border->left += xpad;
+  border->bottom += ypad;
+  border->right += xpad;
+
+  gtk_style_context_get_border (context, state, &tmp);
+  border->top += tmp.top;
+  border->right += tmp.right;
+  border->bottom += tmp.bottom;
+  border->left += tmp.left;
+}
+
diff --git a/gtk/deprecated/gtkmisc.h b/gtk/deprecated/gtkmisc.h
new file mode 100644 (file)
index 0000000..b8d9d46
--- /dev/null
@@ -0,0 +1,93 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
+ * file for a list of people on the GTK+ Team.  See the ChangeLog
+ * files for a list of changes.  These files are distributed with
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __GTK_MISC_H__
+#define __GTK_MISC_H__
+
+
+#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
+#error "Only <gtk/gtk.h> can be included directly."
+#endif
+
+#include <gtk/gtkwidget.h>
+
+
+G_BEGIN_DECLS
+
+#define GTK_TYPE_MISC                 (gtk_misc_get_type ())
+#define GTK_MISC(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MISC, GtkMisc))
+#define GTK_MISC_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MISC, GtkMiscClass))
+#define GTK_IS_MISC(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MISC))
+#define GTK_IS_MISC_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MISC))
+#define GTK_MISC_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MISC, GtkMiscClass))
+
+
+typedef struct _GtkMisc              GtkMisc;
+typedef struct _GtkMiscPrivate       GtkMiscPrivate;
+typedef struct _GtkMiscClass         GtkMiscClass;
+
+struct _GtkMisc
+{
+  GtkWidget widget;
+
+  /*< private >*/
+  GtkMiscPrivate *priv;
+};
+
+struct _GtkMiscClass
+{
+  GtkWidgetClass parent_class;
+
+  /* Padding for future expansion */
+  void (*_gtk_reserved1) (void);
+  void (*_gtk_reserved2) (void);
+  void (*_gtk_reserved3) (void);
+  void (*_gtk_reserved4) (void);
+};
+
+GDK_DEPRECATED_IN_3_14
+GType   gtk_misc_get_type      (void) G_GNUC_CONST;
+GDK_DEPRECATED_IN_3_14
+void   gtk_misc_set_alignment (GtkMisc *misc,
+                               gfloat   xalign,
+                               gfloat   yalign);
+GDK_DEPRECATED_IN_3_14
+void    gtk_misc_get_alignment (GtkMisc *misc,
+                               gfloat  *xalign,
+                               gfloat  *yalign);
+GDK_DEPRECATED_IN_3_14
+void   gtk_misc_set_padding   (GtkMisc *misc,
+                               gint     xpad,
+                               gint     ypad);
+GDK_DEPRECATED_IN_3_14
+void    gtk_misc_get_padding   (GtkMisc *misc,
+                               gint    *xpad,
+                               gint    *ypad);
+
+void   _gtk_misc_get_padding_and_border        (GtkMisc   *misc,
+                                        GtkBorder *border);
+
+G_END_DECLS
+
+#endif /* __GTK_MISC_H__ */
index ae8f932d298ef5ddcb25980c27c4378522c513b9..784d1294565f4475922ac0a97e0051f5472628ee 100644 (file)
--- a/gtk/gtk.h
+++ b/gtk/gtk.h
 #include <gtk/gtkmenushell.h>
 #include <gtk/gtkmenutoolbutton.h>
 #include <gtk/gtkmessagedialog.h>
-#include <gtk/gtkmisc.h>
 #include <gtk/gtkmodules.h>
 #include <gtk/gtkmountoperation.h>
 #include <gtk/gtknotebook.h>
 #include <gtk/deprecated/gtkhseparator.h>
 #include <gtk/deprecated/gtkiconfactory.h>
 #include <gtk/deprecated/gtkimagemenuitem.h>
+#include <gtk/deprecated/gtkmisc.h>
 #include <gtk/deprecated/gtknumerableicon.h>
 #include <gtk/deprecated/gtkradioaction.h>
 #include <gtk/deprecated/gtkrc.h>
index d37a7c5a6402c41bc42f5d21d9c21b9ff0f0d11f..49bc99d8660ea8d299f9a27f087c4f2379208ae0 100644 (file)
@@ -428,7 +428,9 @@ gtk_accel_label_draw (GtkWidget *widget,
 
       cairo_restore (cr);
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
       gtk_misc_get_padding (misc, &xpad, NULL);
+G_GNUC_END_IGNORE_DEPRECATIONS
 
       if (direction == GTK_TEXT_DIR_RTL)
         x = xpad;
index 76f23a61b208cf7175996ed4eec6cffa47130d63..0b09097648ea41fde4e1ef55ad43f4df30c9da18 100644 (file)
@@ -85,7 +85,9 @@ static void     gtk_arrow_get_preferred_height        (GtkWidget           *widg
                                                        gint                *minimum_size,
                                                        gint                *natural_size);
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 G_DEFINE_TYPE_WITH_PRIVATE (GtkArrow, gtk_arrow, GTK_TYPE_MISC)
+G_GNUC_END_IGNORE_DEPRECATIONS
 
 static void
 gtk_arrow_class_init (GtkArrowClass *class)
@@ -199,7 +201,9 @@ gtk_arrow_get_preferred_width (GtkWidget *widget,
 {
   GtkBorder border;
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   _gtk_misc_get_padding_and_border (GTK_MISC (widget), &border);
+G_GNUC_END_IGNORE_DEPRECATIONS
 
   *minimum_size = MIN_ARROW_SIZE + border.left + border.right;
   *natural_size = MIN_ARROW_SIZE + border.left + border.right;
@@ -212,7 +216,9 @@ gtk_arrow_get_preferred_height (GtkWidget *widget,
 {
   GtkBorder border;
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   _gtk_misc_get_padding_and_border (GTK_MISC (widget), &border);
+G_GNUC_END_IGNORE_DEPRECATIONS
 
   *minimum_size = MIN_ARROW_SIZE + border.top + border.bottom;
   *natural_size = MIN_ARROW_SIZE + border.top + border.bottom;
@@ -311,8 +317,10 @@ gtk_arrow_draw (GtkWidget *widget,
   context = gtk_widget_get_style_context (widget);
   gtk_widget_style_get (widget, "arrow-scaling", &arrow_scaling, NULL);
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   _gtk_misc_get_padding_and_border (GTK_MISC (widget), &border);
   gtk_misc_get_alignment (GTK_MISC (widget), &xalign, &yalign);
+G_GNUC_END_IGNORE_DEPRECATIONS
 
   width = gtk_widget_get_allocated_width (widget) - border.left - border.right;
   height = gtk_widget_get_allocated_height (widget) - border.top - border.bottom;
index 27387f8277b10590c0ff115e3bbe3a7618463563..3d193367868ca088565b440519ffe77e10579499 100644 (file)
@@ -30,7 +30,7 @@
 #error "Only <gtk/gtk.h> can be included directly."
 #endif
 
-#include <gtk/gtkmisc.h>
+#include <gtk/deprecated/gtkmisc.h>
 
 
 G_BEGIN_DECLS
index fbd12cfef2a639697fbc14a0e6aea0595474f8b9..4847a65f69b79cd65c8fade9bf1774fd430b6b45 100644 (file)
@@ -1756,15 +1756,17 @@ gtk_assistant_insert_page (GtkAssistant *assistant,
   page_info->current_title = gtk_label_new (NULL);
   gtk_widget_set_no_show_all (page_info->current_title, TRUE);
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   /* Note: we need to use misc alignment here as long as GtkLabel
    * pays attention to it. GtkWiget::halign is ineffective, since
    * all the labels are getting the same size anyway, due to the
    * size group.
    */
   gtk_misc_set_alignment (GTK_MISC (page_info->regular_title), 0, 0.5);
-  gtk_widget_show (page_info->regular_title);
-
   gtk_misc_set_alignment (GTK_MISC (page_info->current_title), 0, 0.5);
+G_GNUC_END_IGNORE_DEPRECATIONS
+
+  gtk_widget_show (page_info->regular_title);
   gtk_widget_hide (page_info->current_title);
 
   context = gtk_widget_get_style_context (page_info->current_title);
index 08f6d6441f5093980835d183112aca8c0af353b3..00d01d2af75df3ded008a55e9cd57088237f8f9e 100644 (file)
@@ -684,10 +684,11 @@ maybe_set_alignment (GtkButton *button,
 {
   GtkButtonPrivate *priv = button->priv;
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   if (GTK_IS_MISC (widget))
     {
       GtkMisc *misc = GTK_MISC (widget);
-      
+
       if (priv->align_set)
        gtk_misc_set_alignment (misc, priv->xalign, priv->yalign);
     }
@@ -706,6 +707,7 @@ maybe_set_alignment (GtkButton *button,
                            priv->xalign, priv->yalign,
                            xscale, yscale);
     }
+G_GNUC_END_IGNORE_DEPRECATIONS
 }
 
 static void
@@ -1291,8 +1293,10 @@ gtk_button_construct_child (GtkButton *button)
 
   gtk_widget_set_valign (label, GTK_ALIGN_BASELINE);
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   if (priv->align_set)
     gtk_misc_set_alignment (GTK_MISC (label), priv->xalign, priv->yalign);
+G_GNUC_END_IGNORE_DEPRECATIONS
 
   gtk_widget_show (label);
   gtk_container_add (GTK_CONTAINER (button), label);
index 467456e3f400a594651d80260710fdfb0b44fc1d..f6cd1a3d5e85ca51df1cc2fd9d9657b4b13c416b 100644 (file)
@@ -197,7 +197,9 @@ enum
   PROP_USE_FALLBACK
 };
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 G_DEFINE_TYPE_WITH_PRIVATE (GtkImage, gtk_image, GTK_TYPE_MISC)
+G_GNUC_END_IGNORE_DEPRECATIONS
 
 static void
 gtk_image_class_init (GtkImageClass *class)
@@ -1523,7 +1525,9 @@ gtk_image_get_preferred_size (GtkImage *image,
 
   context = gtk_widget_get_style_context (GTK_WIDGET (image));
   _gtk_icon_helper_get_size (priv->icon_helper, context, &width, &height);
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   _gtk_misc_get_padding_and_border (GTK_MISC (image), &border);
+G_GNUC_END_IGNORE_DEPRECATIONS
 
   width += border.left + border.right;
   height += border.top + border.bottom;
@@ -1562,7 +1566,6 @@ gtk_image_draw (GtkWidget *widget,
 {
   GtkImage *image;
   GtkImagePrivate *priv;
-  GtkMisc *misc;
   GtkStyleContext *context;
   gint x, y, width, height, baseline;
   gfloat xalign, yalign;
@@ -1571,7 +1574,6 @@ gtk_image_draw (GtkWidget *widget,
   g_return_val_if_fail (GTK_IS_IMAGE (widget), FALSE);
 
   image = GTK_IMAGE (widget);
-  misc = GTK_MISC (image);
   priv = image->priv;
 
   context = gtk_widget_get_style_context (widget);
@@ -1583,9 +1585,11 @@ gtk_image_draw (GtkWidget *widget,
                     0, 0,
                     gtk_widget_get_allocated_width (widget), gtk_widget_get_allocated_height (widget));
 
-  gtk_misc_get_alignment (misc, &xalign, &yalign);
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+  gtk_misc_get_alignment (GTK_MISC (image), &xalign, &yalign);
+  _gtk_misc_get_padding_and_border (GTK_MISC (image), &border);
+G_GNUC_END_IGNORE_DEPRECATIONS
   gtk_image_get_preferred_size (image, &width, &height);
-  _gtk_misc_get_padding_and_border (misc, &border);
 
   if (gtk_widget_get_direction (widget) != GTK_TEXT_DIR_LTR)
     xalign = 1.0 - xalign;
index 3e18fa5eb621e5fa6295c0be2ff308d36ecefd1a..68b9a6d2fc245c17b39b0949b630f147088aa4d5 100644 (file)
@@ -31,7 +31,7 @@
 #endif
 
 #include <gio/gio.h>
-#include <gtk/gtkmisc.h>
+#include <gtk/deprecated/gtkmisc.h>
 
 
 G_BEGIN_DECLS
index 69f633a30a62ed8db550fdd4971b9ae233971298..9be8715a23575801f20975da022513ba969f7c53 100644 (file)
@@ -506,10 +506,12 @@ static void    gtk_label_get_preferred_height_and_baseline_for_width (GtkWidget
 
 static GtkBuildableIface *buildable_parent_iface = NULL;
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 G_DEFINE_TYPE_WITH_CODE (GtkLabel, gtk_label, GTK_TYPE_MISC,
                          G_ADD_PRIVATE (GtkLabel)
-                        G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
-                                               gtk_label_buildable_interface_init))
+                         G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
+                                                gtk_label_buildable_interface_init))
+G_GNUC_END_IGNORE_DEPRECATIONS
 
 static void
 add_move_binding (GtkBindingSet  *binding_set,
@@ -3226,7 +3228,9 @@ gtk_label_update_layout_width (GtkLabel *label)
       PangoRectangle logical;
       gint width, height;
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
       _gtk_misc_get_padding_and_border (GTK_MISC (label), &border);
+G_GNUC_END_IGNORE_DEPRECATIONS
 
       width = gtk_widget_get_allocated_width (GTK_WIDGET (label)) - border.left - border.right;
       height = gtk_widget_get_allocated_height (GTK_WIDGET (label)) - border.top - border.bottom;
@@ -3643,7 +3647,9 @@ gtk_label_get_preferred_size (GtkWidget      *widget,
   smallest_rect.width  = PANGO_PIXELS_CEIL (smallest_rect.width);
   smallest_rect.height = PANGO_PIXELS_CEIL (smallest_rect.height);
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   _gtk_misc_get_padding_and_border (GTK_MISC (label), &border);
+G_GNUC_END_IGNORE_DEPRECATIONS
 
   if (orientation == GTK_ORIENTATION_HORIZONTAL)
     {
@@ -3747,7 +3753,9 @@ gtk_label_get_preferred_width_for_height (GtkWidget *widget,
     {
       GtkBorder border;
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
       _gtk_misc_get_padding_and_border (GTK_MISC (label), &border);
+G_GNUC_END_IGNORE_DEPRECATIONS
 
       if (priv->wrap)
         gtk_label_clear_layout (label);
@@ -3782,7 +3790,9 @@ gtk_label_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
     {
       GtkBorder border;
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
       _gtk_misc_get_padding_and_border (GTK_MISC (label), &border);
+G_GNUC_END_IGNORE_DEPRECATIONS
 
       if (priv->wrap)
         gtk_label_clear_layout (label);
@@ -3914,7 +3924,6 @@ get_layout_location (GtkLabel  *label,
                      gint      *yp)
 {
   GtkAllocation allocation;
-  GtkMisc *misc;
   GtkWidget *widget;
   GtkLabelPrivate *priv;
   GtkBorder border;
@@ -3924,12 +3933,13 @@ get_layout_location (GtkLabel  *label,
   PangoRectangle logical;
   gint baseline, layout_baseline, baseline_offset;
 
-  misc   = GTK_MISC (label);
   widget = GTK_WIDGET (label);
   priv   = label->priv;
 
-  gtk_misc_get_alignment (misc, &xalign, &yalign);
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+  gtk_misc_get_alignment (GTK_MISC (label), &xalign, &yalign);
   _gtk_misc_get_padding_and_border (GTK_MISC (label), &border);
+G_GNUC_END_IGNORE_DEPRECATIONS
 
   if (gtk_widget_get_direction (widget) != GTK_TEXT_DIR_LTR)
     xalign = 1.0 - xalign;
index 1f4f74d86da21662456c3a12baf1ebf78956f1ac..19f8806586df4dbf93cba30649826eca6c72fc84 100644 (file)
@@ -30,7 +30,7 @@
 #error "Only <gtk/gtk.h> can be included directly."
 #endif
 
-#include <gtk/gtkmisc.h>
+#include <gtk/deprecated/gtkmisc.h>
 #include <gtk/gtkwindow.h>
 #include <gtk/gtkmenu.h>
 
diff --git a/gtk/gtkmisc.c b/gtk/gtkmisc.c
deleted file mode 100644 (file)
index 67fd73b..0000000
+++ /dev/null
@@ -1,431 +0,0 @@
-/* GTK - The GIMP Toolkit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/*
- * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
- * file for a list of people on the GTK+ Team.  See the ChangeLog
- * files for a list of changes.  These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
- */
-
-#include "config.h"
-#include "gtkcontainer.h"
-#include "gtkmisc.h"
-#include "gtkintl.h"
-#include "gtkprivate.h"
-
-
-/**
- * SECTION:gtkmisc
- * @Short_description: Base class for widgets with alignments and padding
- * @Title: GtkMisc
- *
- * The #GtkMisc widget is an abstract widget which is not useful itself, but
- * is used to derive subclasses which have alignment and padding attributes.
- *
- * The horizontal and vertical padding attributes allows extra space to be
- * added around the widget.
- *
- * The horizontal and vertical alignment attributes enable the widget to be
- * positioned within its allocated area. Note that if the widget is added to
- * a container in such a way that it expands automatically to fill its
- * allocated area, the alignment settings will not alter the widgets position.
- *
- * Note that the desired effect can in most cases be achieved by using the
- * #GtkWidget:halign, #GtkWidget:valign and #GtkWidget:margin properties
- * on the child widget, so GtkMisc should not be used in new code.
- */
-
-
-struct _GtkMiscPrivate
-{
-  gfloat        xalign;
-  gfloat        yalign;
-
-  guint16       xpad;
-  guint16       ypad;
-};
-
-enum {
-  PROP_0,
-  PROP_XALIGN,
-  PROP_YALIGN,
-  PROP_XPAD,
-  PROP_YPAD
-};
-
-static void gtk_misc_realize      (GtkWidget    *widget);
-static void gtk_misc_set_property (GObject         *object,
-                                  guint            prop_id,
-                                  const GValue    *value,
-                                  GParamSpec      *pspec);
-static void gtk_misc_get_property (GObject         *object,
-                                  guint            prop_id,
-                                  GValue          *value,
-                                  GParamSpec      *pspec);
-
-
-G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GtkMisc, gtk_misc, GTK_TYPE_WIDGET)
-
-static void
-gtk_misc_class_init (GtkMiscClass *class)
-{
-  GObjectClass   *gobject_class;
-  GtkWidgetClass *widget_class;
-
-  gobject_class = G_OBJECT_CLASS (class);
-  widget_class = (GtkWidgetClass*) class;
-
-  gobject_class->set_property = gtk_misc_set_property;
-  gobject_class->get_property = gtk_misc_get_property;
-  
-  widget_class->realize = gtk_misc_realize;
-
-  g_object_class_install_property (gobject_class,
-                                   PROP_XALIGN,
-                                   g_param_spec_float ("xalign",
-                                                      P_("X align"),
-                                                      P_("The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL layouts."),
-                                                      0.0,
-                                                      1.0,
-                                                      0.5,
-                                                      GTK_PARAM_READWRITE));
-
-  g_object_class_install_property (gobject_class,
-                                   PROP_YALIGN,
-                                   g_param_spec_float ("yalign",
-                                                      P_("Y align"),
-                                                      P_("The vertical alignment, from 0 (top) to 1 (bottom)"),
-                                                      0.0,
-                                                      1.0,
-                                                      0.5,
-                                                      GTK_PARAM_READWRITE));
-
-  g_object_class_install_property (gobject_class,
-                                   PROP_XPAD,
-                                   g_param_spec_int ("xpad",
-                                                    P_("X pad"),
-                                                    P_("The amount of space to add on the left and right of the widget, in pixels"),
-                                                    0,
-                                                    G_MAXINT,
-                                                    0,
-                                                    GTK_PARAM_READWRITE));
-
-  g_object_class_install_property (gobject_class,
-                                   PROP_YPAD,
-                                   g_param_spec_int ("ypad",
-                                                    P_("Y pad"),
-                                                    P_("The amount of space to add on the top and bottom of the widget, in pixels"),
-                                                    0,
-                                                    G_MAXINT,
-                                                    0,
-                                                    GTK_PARAM_READWRITE));
-}
-
-static void
-gtk_misc_init (GtkMisc *misc)
-{
-  GtkMiscPrivate *priv;
-
-  misc->priv = gtk_misc_get_instance_private (misc); 
-  priv = misc->priv;
-
-  priv->xalign = 0.5;
-  priv->yalign = 0.5;
-  priv->xpad = 0;
-  priv->ypad = 0;
-}
-
-static void
-gtk_misc_set_property (GObject      *object,
-                      guint         prop_id,
-                      const GValue *value,
-                      GParamSpec   *pspec)
-{
-  GtkMisc *misc = GTK_MISC (object);
-  GtkMiscPrivate *priv = misc->priv;
-
-  switch (prop_id)
-    {
-    case PROP_XALIGN:
-      gtk_misc_set_alignment (misc, g_value_get_float (value), priv->yalign);
-      break;
-    case PROP_YALIGN:
-      gtk_misc_set_alignment (misc, priv->xalign, g_value_get_float (value));
-      break;
-    case PROP_XPAD:
-      gtk_misc_set_padding (misc, g_value_get_int (value), priv->ypad);
-      break;
-    case PROP_YPAD:
-      gtk_misc_set_padding (misc, priv->xpad, g_value_get_int (value));
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-    }
-}
-
-static void
-gtk_misc_get_property (GObject      *object,
-                      guint         prop_id,
-                      GValue       *value,
-                      GParamSpec   *pspec)
-{
-  GtkMisc *misc = GTK_MISC (object);
-  GtkMiscPrivate *priv = misc->priv;
-
-  switch (prop_id)
-    {
-    case PROP_XALIGN:
-      g_value_set_float (value, priv->xalign);
-      break;
-    case PROP_YALIGN:
-      g_value_set_float (value, priv->yalign);
-      break;
-    case PROP_XPAD:
-      g_value_set_int (value, priv->xpad);
-      break;
-    case PROP_YPAD:
-      g_value_set_int (value, priv->ypad);
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-    }
-}
-
-/**
- * gtk_misc_set_alignment:
- * @misc: a #GtkMisc.
- * @xalign: the horizontal alignment, from 0 (left) to 1 (right).
- * @yalign: the vertical alignment, from 0 (top) to 1 (bottom).
- *
- * Sets the alignment of the widget.
- */
-void
-gtk_misc_set_alignment (GtkMisc *misc,
-                       gfloat   xalign,
-                       gfloat   yalign)
-{
-  GtkMiscPrivate *priv;
-  GtkWidget *widget;
-
-  g_return_if_fail (GTK_IS_MISC (misc));
-
-  priv = misc->priv;
-
-  if (xalign < 0.0)
-    xalign = 0.0;
-  else if (xalign > 1.0)
-    xalign = 1.0;
-
-  if (yalign < 0.0)
-    yalign = 0.0;
-  else if (yalign > 1.0)
-    yalign = 1.0;
-
-  if ((xalign != priv->xalign) || (yalign != priv->yalign))
-    {
-      g_object_freeze_notify (G_OBJECT (misc));
-      if (xalign != priv->xalign)
-       g_object_notify (G_OBJECT (misc), "xalign");
-
-      if (yalign != priv->yalign)
-       g_object_notify (G_OBJECT (misc), "yalign");
-
-      priv->xalign = xalign;
-      priv->yalign = yalign;
-      
-      /* clear the area that was allocated before the change
-       */
-      widget = GTK_WIDGET (misc);
-      if (gtk_widget_is_drawable (widget))
-        gtk_widget_queue_draw (widget);
-
-      g_object_thaw_notify (G_OBJECT (misc));
-    }
-}
-
-/**
- * gtk_misc_get_alignment:
- * @misc: a #GtkMisc
- * @xalign: (out) (allow-none): location to store X alignment of @misc, or %NULL
- * @yalign: (out) (allow-none): location to store Y alignment of @misc, or %NULL
- *
- * Gets the X and Y alignment of the widget within its allocation. 
- * See gtk_misc_set_alignment().
- **/
-void
-gtk_misc_get_alignment (GtkMisc *misc,
-                       gfloat  *xalign,
-                       gfloat  *yalign)
-{
-  GtkMiscPrivate *priv;
-
-  g_return_if_fail (GTK_IS_MISC (misc));
-
-  priv = misc->priv;
-
-  if (xalign)
-    *xalign = priv->xalign;
-  if (yalign)
-    *yalign = priv->yalign;
-}
-
-/**
- * gtk_misc_set_padding:
- * @misc: a #GtkMisc.
- * @xpad: the amount of space to add on the left and right of the widget,
- *   in pixels.
- * @ypad: the amount of space to add on the top and bottom of the widget,
- *   in pixels.
- *
- * Sets the amount of space to add around the widget.
- */
-void
-gtk_misc_set_padding (GtkMisc *misc,
-                     gint     xpad,
-                     gint     ypad)
-{
-  GtkMiscPrivate *priv;
-
-  g_return_if_fail (GTK_IS_MISC (misc));
-
-  priv = misc->priv;
-
-  if (xpad < 0)
-    xpad = 0;
-  if (ypad < 0)
-    ypad = 0;
-
-  if ((xpad != priv->xpad) || (ypad != priv->ypad))
-    {
-      g_object_freeze_notify (G_OBJECT (misc));
-      if (xpad != priv->xpad)
-       g_object_notify (G_OBJECT (misc), "xpad");
-
-      if (ypad != priv->ypad)
-       g_object_notify (G_OBJECT (misc), "ypad");
-
-      priv->xpad = xpad;
-      priv->ypad = ypad;
-
-      if (gtk_widget_is_drawable (GTK_WIDGET (misc)))
-       gtk_widget_queue_resize (GTK_WIDGET (misc));
-
-      g_object_thaw_notify (G_OBJECT (misc));
-    }
-}
-
-/**
- * gtk_misc_get_padding:
- * @misc: a #GtkMisc
- * @xpad: (out) (allow-none): location to store padding in the X
- *        direction, or %NULL
- * @ypad: (out) (allow-none): location to store padding in the Y
- *        direction, or %NULL
- *
- * Gets the padding in the X and Y directions of the widget. 
- * See gtk_misc_set_padding().
- **/
-void
-gtk_misc_get_padding (GtkMisc *misc,
-                     gint    *xpad,
-                     gint    *ypad)
-{
-  GtkMiscPrivate *priv;
-
-  g_return_if_fail (GTK_IS_MISC (misc));
-
-  priv = misc->priv;
-
-  if (xpad)
-    *xpad = priv->xpad;
-  if (ypad)
-    *ypad = priv->ypad;
-}
-
-static void
-gtk_misc_realize (GtkWidget *widget)
-{
-  GtkAllocation allocation;
-  GdkWindow *window;
-  GdkWindowAttr attributes;
-  gint attributes_mask;
-
-  gtk_widget_set_realized (widget, TRUE);
-
-  if (!gtk_widget_get_has_window (widget))
-    {
-      window = gtk_widget_get_parent_window (widget);
-      gtk_widget_set_window (widget, window);
-      g_object_ref (window);
-    }
-  else
-    {
-      gtk_widget_get_allocation (widget, &allocation);
-
-      attributes.window_type = GDK_WINDOW_CHILD;
-      attributes.x = allocation.x;
-      attributes.y = allocation.y;
-      attributes.width = allocation.width;
-      attributes.height = allocation.height;
-      attributes.wclass = GDK_INPUT_OUTPUT;
-      attributes.visual = gtk_widget_get_visual (widget);
-      attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK;
-      attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
-
-      window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask);
-      gtk_widget_set_window (widget, window);
-      gtk_widget_register_window (widget, window);
-      gdk_window_set_background_pattern (window, NULL);
-    }
-}
-
-/* Semi-private function used by gtk widgets inheriting from
- * GtkMisc that takes into account both css padding and border
- * and the padding specified with the GtkMisc properties.
- */
-void
-_gtk_misc_get_padding_and_border (GtkMisc   *misc,
-                                  GtkBorder *border)
-{
-  GtkStyleContext *context;
-  GtkStateFlags state;
-  GtkBorder tmp;
-  gint xpad, ypad;
-
-  g_return_if_fail (GTK_IS_MISC (misc));
-
-  context = gtk_widget_get_style_context (GTK_WIDGET (misc));
-  state = gtk_widget_get_state_flags (GTK_WIDGET (misc));
-
-  gtk_style_context_get_padding (context, state, border);
-
-  gtk_misc_get_padding (misc, &xpad, &ypad);
-  border->top += ypad;
-  border->left += xpad;
-  border->bottom += ypad;
-  border->right += xpad;
-
-  gtk_style_context_get_border (context, state, &tmp);
-  border->top += tmp.top;
-  border->right += tmp.right;
-  border->bottom += tmp.bottom;
-  border->left += tmp.left;
-}
-
diff --git a/gtk/gtkmisc.h b/gtk/gtkmisc.h
deleted file mode 100644 (file)
index b070c50..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/* GTK - The GIMP Toolkit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/*
- * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
- * file for a list of people on the GTK+ Team.  See the ChangeLog
- * files for a list of changes.  These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
- */
-
-#ifndef __GTK_MISC_H__
-#define __GTK_MISC_H__
-
-
-#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only <gtk/gtk.h> can be included directly."
-#endif
-
-#include <gtk/gtkwidget.h>
-
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_MISC                 (gtk_misc_get_type ())
-#define GTK_MISC(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MISC, GtkMisc))
-#define GTK_MISC_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MISC, GtkMiscClass))
-#define GTK_IS_MISC(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MISC))
-#define GTK_IS_MISC_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MISC))
-#define GTK_MISC_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MISC, GtkMiscClass))
-
-
-typedef struct _GtkMisc              GtkMisc;
-typedef struct _GtkMiscPrivate       GtkMiscPrivate;
-typedef struct _GtkMiscClass         GtkMiscClass;
-
-struct _GtkMisc
-{
-  GtkWidget widget;
-
-  /*< private >*/
-  GtkMiscPrivate *priv;
-};
-
-struct _GtkMiscClass
-{
-  GtkWidgetClass parent_class;
-
-  /* Padding for future expansion */
-  void (*_gtk_reserved1) (void);
-  void (*_gtk_reserved2) (void);
-  void (*_gtk_reserved3) (void);
-  void (*_gtk_reserved4) (void);
-};
-
-GDK_AVAILABLE_IN_ALL
-GType   gtk_misc_get_type      (void) G_GNUC_CONST;
-GDK_AVAILABLE_IN_ALL
-void   gtk_misc_set_alignment (GtkMisc *misc,
-                               gfloat   xalign,
-                               gfloat   yalign);
-GDK_AVAILABLE_IN_ALL
-void    gtk_misc_get_alignment (GtkMisc *misc,
-                               gfloat  *xalign,
-                               gfloat  *yalign);
-GDK_AVAILABLE_IN_ALL
-void   gtk_misc_set_padding   (GtkMisc *misc,
-                               gint     xpad,
-                               gint     ypad);
-GDK_AVAILABLE_IN_ALL
-void    gtk_misc_get_padding   (GtkMisc *misc,
-                               gint    *xpad,
-                               gint    *ypad);
-
-void   _gtk_misc_get_padding_and_border        (GtkMisc   *misc,
-                                        GtkBorder *border);
-
-G_END_DECLS
-
-#endif /* __GTK_MISC_H__ */
index c8a51a6810755785dfc38915d750ae3d05acc54c..bd218bbd60e5068ca3647d7349a8d6a91f222980 100644 (file)
@@ -489,9 +489,11 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
           if (text_orientation == GTK_ORIENTATION_HORIZONTAL)
            {
               gtk_label_set_angle (GTK_LABEL (label), 0);
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
               gtk_misc_set_alignment (GTK_MISC (label),
                                       gtk_tool_item_get_text_alignment (GTK_TOOL_ITEM (button)),
                                       0.5);
+G_GNUC_END_IGNORE_DEPRECATIONS
             }
           else
             {
@@ -500,9 +502,11 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
                gtk_label_set_angle (GTK_LABEL (label), -90);
              else
                gtk_label_set_angle (GTK_LABEL (label), 90);
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
               gtk_misc_set_alignment (GTK_MISC (label),
                                       0.5,
                                       1 - gtk_tool_item_get_text_alignment (GTK_TOOL_ITEM (button)));
+G_GNUC_END_IGNORE_DEPRECATIONS
             }
         }
     }
@@ -543,6 +547,7 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
          gtk_widget_show (icon);
        }
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
       if (GTK_IS_MISC (icon) && text_orientation == GTK_ORIENTATION_HORIZONTAL)
        gtk_misc_set_alignment (GTK_MISC (icon),
                                1.0 - gtk_tool_item_get_text_alignment (GTK_TOOL_ITEM (button)),
@@ -551,6 +556,7 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
        gtk_misc_set_alignment (GTK_MISC (icon),
                                0.5,
                                gtk_tool_item_get_text_alignment (GTK_TOOL_ITEM (button)));
+G_GNUC_END_IGNORE_DEPRECATIONS
 
       if (icon)
        {